<template>
  <div style="width: 100%; height: 100%;" >
    <div class="container">
        <el-form @submit.prevent :model="form">
      <el-form-item label="用户名" prop="username">
        <el-input v-model="form.username" placeholder="请输入用户名"></el-input>
      </el-form-item>
      <el-form-item label="密码" prop="password">
        <el-input v-model="form.password" placeholder="请输入用户名"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">提交</el-button>
      </el-form-item>
    </el-form>
    </div>
  </div>
</template>

<script setup>
import { reactive, ref } from 'vue';
import { submit } from './http'

  const form = reactive({
    username: "",
    password: "",
  });


async function onSubmit () {
  try {
    const res = await submit({ ...form })
    console.log('res', res)
  } catch (error) {
    console.log('error', error)
  }
}
</script>
<style scoped lang="scss">
.container {
  width: 400px;
  background-color: #fff;
  padding: 10px 20px;
  box-shadow: 5px 5px 5px 1px;
}
</style>
